--------------------------------------------------------------------------------
README for: “Accountability, Political Capture and Selection into Politics: Evidence from Peruvian Municipalities” 
The Review of Economics and Statistics
By: Miriam Artiles, Lukas Kleine-Rueschkamp and Gianmarco León-Ciliotta

yyyy-mm-dd: 2020-01-08
--------------------------------------------------------------------------------

>>> REPLICATION INSTRUCTIONS


(a) Tables.do
    > Runs regressions for Tables 1-5

(b) Figure.do
    > Creates Figure 1    

(c) Tables_appendix.do
    > Runs regressions for Tables A1-A16

(d) Figures_appendix.do
    > Creates Figure A2   
    > Creates Figures A6-A11


The folder log_files contains the output from running (a)-(d) with Stata/MP 14.1. 
(OS X Yosemite 10.10.5)
--------------------------------------------------------------------------------

>>> DATA DESCRIPTION


(1) Political Data:

> Data on the list of candidates running for each election, their party affiliations and vote shares to compute the win margin of the elected mayor was obtained from the Oficina Nacional de Procesos Electorales (ONPE). The number of purchased kits for signature collection in order to recall a mayor, the name of the mayor subjected to the recall attempt, whether a recall election took place during the electoral cycle, and whether or not the mayor was successfully recalled was also provided by the ONPE.

> Political variables regarding turnout (% of casted votes relative to electorate’s size), the number of candidates contesting for the office of mayor, and win margin (difference in % points of valid votes between the mayoral winner’s party and the runner’s-up party) were obtained from the Jurado Nacional de Elecciones (JNE). The measure of political competition (effective number of candidates) is computed as the inverse of the sum of squared vote shares of each running candidate within the electoral race.

(2) Candidates’ Characteristics (CV Data):

Online CVs of candidates running for mayor provide data on the candidate’s education, experience and personal characteristics. They can be accessed via INFOGOB (www.Infogob.com.pe). Using CVs data we coded:

> Education: whether the candidate has only primary education or less (Prim2), whether she only completed up to secondary education (Sec2), whether she only studied a technical/vocational degree after secondary education (Tec), and whether she attended university, including postgraduate degrees (Uni). Using this information we impute the number of years of education (yrs_edu). 

> Experience and personal characteristics: number of years serving in some elected public office (yrs_elected), number of years serving as mayor (yrs_mayor), number of years serving in party office (yrs_partyoffice), whether the candidate is a member of a national political party (nationalparty), and whether she has previous experienced working in the public (work_public) and private (work_private) sector. We also coded information on the age (year of election minus birth year) and gender (female dummy).

(4) District Data:

> Data on the percentage of budget executed during tenure (RealisedExpenses), and log revenues (log_pim_ultimos3) and expenditures (log_ejec_ultimos3) over the last three years of the mayor’s term were obtained from the Ministry of Economy and Finance (MEF, http://apps5.mineco.gob.pe/transparencia/Navegador/Default.aspx).

> Population data for the years 2002, 2006, 2010 and 2014 were obtained from the Peruvian Institute of Statistics (INEI).

> The percentage of the district’s population with an indigenous language (Quechua/Aymara) as mother tongue (CS07_per_ind_qa) is obtained from the 2007 population census (INEI).

(5) Representation:

> Surname classification: we classify candidates’ surnames as indigenous if they contain some Quechua or Aymara linguistic root. See Appendix A for the list of dictionary sources used to identify Hispanic surnames and surnames from the Quechua/Aymara language families.

> Using the surname classification, we coded whether the candidate has at least one indigenous surname (ind) and whether she has two indigenous surnames (ind2). Additionally, we define a candidate as representative is she has at least one indigenous surname and she is running for mayor in a district where at least 25 percent (rep_ind_dnative_25per), 50 percent (rep_ind_dnative_50per) or 75 percent (rep_ind_dnative_75per) of the population has an indigenous mother tongue according to the 2007 population census.

(6) Neighbours:

> Information on driving distance and duration between district capitals was extracted from Google Maps Services using a Google Maps Distance Matrix API. We define neighboring municipalities as those for which the travel time is lower than 2 hours. The file base_neighbours.dta reports the 10 closest neighbours for each municipality. Note that the definition of neighboring municipalities is time invariant. Information on travel time using the Google Maps API was accessed in May 2019.
